#ifndef _KC_TCPCLIENT_H__KC_
#define _KC_TCPCLIENT_H__KC_

#include <openssl/bio.h>
#include "../CommClient.h"
#include "../../logs/Logger.h"
#include "../CommCommon.h"

namespace kc_sf
{
	class TCPClient : public CommClient
	{
		public:

			TCPClient();
			virtual ~TCPClient();

			virtual void connectToSrv( const std::string &srv_name, int srv_port );
			virtual bool isConnected() const;
			virtual void disconnect();

			virtual void recvData( std::string &to, const std::string &until_str, int timeout );
			virtual void sendData( const std::string &what, int timeout );

			unsigned long connectionId() { return cl_cid; }

		protected:

			int cl_sock;
			unsigned long cl_cid; // identyfikator polaczenia SMTP, connection id
			CommCommon *cl_comm;
			Logger cl_logger;
	};
}

#endif // _KC_TCPCLIENT_H__KC_
